package com.ruoyi.member.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.member.domain.MemberBlacklist;
import com.ruoyi.member.mapper.MemberBlacklistMapper;
import com.ruoyi.member.service.IMemberBlacklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 研究所黑名单Service业务层处理
 *
 * @author Marissa
 * @date 2023-12-06
 */
@Service
public class MemberBlacklistServiceImpl implements IMemberBlacklistService {
    @Autowired
    private MemberBlacklistMapper memberBlacklistMapper;

    /**
     * 查询研究所黑名单
     *
     * @param bId 研究所黑名单主键
     * @return 研究所黑名单
     */
    @Override
    public MemberBlacklist selectMemberBlacklistByBId(Long bId) {
        return memberBlacklistMapper.selectMemberBlacklistByBId(bId);
    }

    /**
     * 查询研究所黑名单列表
     *
     * @param memberBlacklist 研究所黑名单
     * @return 研究所黑名单
     */
    @Override
    public List<MemberBlacklist> selectMemberBlacklistList(MemberBlacklist memberBlacklist) {
        return memberBlacklistMapper.selectMemberBlacklistList(memberBlacklist);
    }

    /**
     * 新增研究所黑名单
     *
     * @param memberBlacklist 研究所黑名单
     * @return 结果
     */
    @Override
    public int insertMemberBlacklist(MemberBlacklist memberBlacklist) {
        memberBlacklist.setCreateTime(DateUtils.getNowDate());
        return memberBlacklistMapper.insertMemberBlacklist(memberBlacklist);
    }

    /**
     * 修改研究所黑名单
     *
     * @param memberBlacklist 研究所黑名单
     * @return 结果
     */
    @Override
    public int updateMemberBlacklist(MemberBlacklist memberBlacklist) {
        memberBlacklist.setUpdateTime(DateUtils.getNowDate());
        return memberBlacklistMapper.updateMemberBlacklist(memberBlacklist);
    }

    /**
     * 批量删除研究所黑名单
     *
     * @param bIds 需要删除的研究所黑名单主键
     * @return 结果
     */
    @Override
    public int deleteMemberBlacklistByBIds(Long[] bIds) {
        return memberBlacklistMapper.deleteMemberBlacklistByBIds(bIds);
    }

    /**
     * 删除研究所黑名单信息
     *
     * @param bId 研究所黑名单主键
     * @return 结果
     */
    @Override
    public int deleteMemberBlacklistByBId(Long bId) {
        return memberBlacklistMapper.deleteMemberBlacklistByBId(bId);
    }
}
